package com.bsoft.gol.hcs.specialist.dao;

import ctd.persistence.annotation.DAOMethod;
import ctd.persistence.annotation.DAOParam;
import ctd.persistence.support.hibernate.HibernateSupportDelegateDAO;
import hcn.specialist.BaseComplaintRect;

import java.util.List;

/**
 * @Author zsf
 * @Date 2023/10/19 0019 9:32
 * @PackageName:com.bsoft.gol.hcs.specialist.dao
 * @ClassName: BaseComplaintRectDAO
 * @Description: 投诉整改表
 * @Version 4.0.02
 */
public abstract class BaseComplaintRectDAO extends HibernateSupportDelegateDAO<BaseComplaintRect> {
    public BaseComplaintRectDAO() {
        this.setKeyField("rectId");
    }

    @DAOMethod(sql = "delete from BaseComplaintRect where complaintId=:complaintId and rectId not in(:list)")
    public abstract void removeByRectIdList(@DAOParam("complaintId") String complaintId,@DAOParam("list") List<String> list);

    @DAOMethod(sql = " from BaseComplaintRect where complaintId =:complaintId order by deptFlag asc ")
    public abstract List<BaseComplaintRect> findComplaintRect(@DAOParam("complaintId") String complaintId);

    @DAOMethod(sql = " from BaseComplaintRect where complaintId =:complaintId and deptFlag=1 ")
    public abstract BaseComplaintRect getComplaintRectMain(@DAOParam("complaintId") String complaintId);


    @DAOMethod(sql = " update BaseComplaintRect set status=:status where complaintId =:complaintId ")
    public abstract void updateStatusByComplaintId(@DAOParam("complaintId") String complaintId,@DAOParam("status") byte status);


    @DAOMethod(sql = " update  BaseComplaintRect set accurReason=:accurReason,rectContent=:rectContent,systemProcess =:systemProcess,status=:status where rectId =:rectId ")
    public abstract void updateComplaintRect(@DAOParam("rectId") String rectId,@DAOParam("accurReason") String accurReason,@DAOParam("rectContent") String rectContent,@DAOParam("systemProcess") String systemProcess,@DAOParam("status") byte status);

    /**
    * @description: 查询未整改的列表
     * @param complaintId
     * @return java.util.List<hcn.specialist.BaseComplaintRect>
    * @author: zsf
    * @date: 2023/10/28 0028 10:38
    */
    @DAOMethod(sql = " from BaseComplaintRect where complaintId =:complaintId and status = 0 ")
    public abstract List<BaseComplaintRect> findComplaintRectStatus(@DAOParam("complaintId") String complaintId);
}
